feat(launch): make Headroom opt-in and wire RTK when the entry file lacks the block - #22
Merged
Merged
Conversation
…acks the block What a bare `scc launch` does, and does not, is now settled by one question: does this leave anything behind after the session ends? Headroom's `wrap` does — it registers MCP servers into the agent's own config, and those registrations outlive the session that made them, which is why Headroom ships `unwrap` at all. What it buys is one session of compression, so it moves behind `--headroom`; without the flag scc does not even look for the binary, and the report omits the field entirely rather than saying "skipped". Any `--headroom-*` flag implies `--headroom`, because accepting a flag and then ignoring it is how somebody spends a session believing they configured something. With the flag, the internal defaults are unchanged: `--headroom-mcp none` and `--no-context-tool`. RTK goes the other way, and the trigger is the block rather than the binary: it runs when an entry file carries no RTK block and does nothing at all when they all do. That bound is what lets it be the default — it fires once per workspace rather than once per session, so a wired workspace pays no cargo prompt and no edit at the top of every session. The write is the point: an agent that never read the block never types the prefix, so installing the binary and leaving the file alone would buy nothing. It splices with keep, so a block already there is left exactly as it is even when scc ships a different one; replacing somebody's block is a real trade-off and `scc rtk` is where it is made deliberately. Two smaller consequences. A plan-only run now passes check through to applyRTK, which closes a real hole: `--rtk --dry-run` used to splice the entry file, the one flag nobody expects to change anything doing exactly that. And a workspace whose block is present while the binary is not gets one warning and no action — the file tells the agent to use a binary this machine lacks, but that is a PATH problem on the user's side rather than something to fix mid-launch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CAEQdLsrScdfaa1ut2H7g
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What a bare
scc launchdoes, and does not, is now settled by one question: does this leave anything behind after the session ends?Headroom moves behind
--headroomheadroom wrapregisters MCP servers into the agent's own config, and those registrations outlive the session that made them — which is why Headroom shipsunwrapat all. What it buys is one session of compression. That trade is no longer made on the user's behalf: without--headroom, scc does not even look for the binary, and the report omits theheadroomfield entirely rather than sayingskipped— a launch that never considered Headroom and one that considered it and could not use it are different answers.Any
--headroom-*flag implies--headroom, because accepting a flag and then ignoring it is how somebody spends a session believing they configured something. With the flag, the internal defaults are unchanged:--headroom-mcp noneand--no-context-tool.--no-headroomis gone; it has nothing left to turn off.RTK goes the other way, bounded by the block
scc launchnow makes sure the entry file the agent is about to load actually mentions RTK — the same setupscc rtkdoes standalone. The trigger is the block, not the binary: it runs when an entry file carries none, and does nothing at all when they all do.That bound is what lets it be the default. It fires once per workspace rather than once per session, so a wired workspace pays no cargo prompt and no edit at the top of every session. The write is the point — an agent that never read the block never types the prefix, so installing the binary and leaving the file alone would buy nothing.
It splices with
keep, so a block already there is left exactly as it is even when scc ships a different one. Replacing somebody's block is a real trade-off, andscc rtkis where it is made deliberately, not a side effect of starting an agent.--no-rtkopts out.Two smaller consequences
checknow goes through toapplyRTK, which closes a real hole:--rtk --dry-runused to splice the entry file — the one flag nobody expects to change anything doing exactly that.Tests
--no-headroomdropped from 18 incidental call sites,--headroomadded to the ones that assert on the wrap.TestLaunchRTKIsOptIngave way to five tests: writes when the block is missing, leaves a block that is already there byte-identical,--no-rtkomits everything, plan-only writes nothing, and it degrades without cargo.gofmt,go vetand the full suite are green locally (the race detector needs a C compiler this machine does not have; CI covers it).🤖 Generated with Claude Code
https://claude.ai/code/session_018CAEQdLsrScdfaa1ut2H7g